#include "font.h"

const struct font_16x16_t font_16x16[] = 
{
    0XB0A1 { 0X3f,0X20,0X7f,0X20,0X7f,0X42,0X4d,0X70,0X00,0X47,0X44,0X4f,0X44,0X7f,0X40,0X00,
             0X70,0X20,0X70,0X00,0X7f,0X10,0X08,0X70,0X00,0X70,0X20,0X72,0X01,0X7f,0X00,0X00}
    0XB0A2 { 0X00,0X7f,0X40,0X44,0X5b,0X60,0X40,0X47,0X44,0X44,0X4f,0X44,0X7f,0X40,0X40,0X00,
             0X00,0X7f,0X10,0X08,0X10,0X60,0X00,0X78,0X10,0X10,0X7a,0X01,0X7e,0X00,0X00,0X00}
    0XB0A3 { 0X04,0X04,0X04,0X7f,0X04,0X04,0X08,0X1b,0X29,0X49,0X09,0X2b,0X19,0X0c,0X00,0X00,
             0X08,0X0c,0X08,0X78,0X10,0X31,0X21,0X22,0X2c,0X70,0X28,0X24,0X22,0X63,0X22,0X00}
    0XB0A4 { 0X08,0X08,0X08,0X7f,0X08,0X09,0X08,0X1b,0X29,0X49,0X09,0X2b,0X19,0X0c,0X00,0X00,
             0X20,0X22,0X41,0X7e,0X00,0X21,0X21,0X22,0X2c,0X70,0X28,0X24,0X22,0X63,0X22,0X00}
    0XB0A5 { 0X00,0X1f,0X10,0X10,0X3f,0X10,0X10,0X13,0X7c,0X10,0X10,0X7c,0X13,0X30,0X10,0X00,
             0X00,0X78,0X10,0X10,0X78,0X01,0X02,0X04,0X48,0X30,0X28,0X44,0X02,0X03,0X02,0X00}
    0XB0A6 { 0X00,0X1f,0X10,0X10,0X3f,0X10,0X08,0X1b,0X29,0X49,0X09,0X2b,0X19,0X0c,0X00,0X00,
             0X00,0X78,0X10,0X10,0X78,0X21,0X21,0X22,0X2c,0X70,0X28,0X24,0X22,0X63,0X22,0X00}
    0XB0A7 { 0X20,0X20,0X20,0X2f,0X28,0X28,0X28,0X68,0X28,0X28,0X28,0X3f,0X28,0X60,0X20,0X00,
             0X04,0X04,0X08,0X10,0X20,0X7f,0X02,0X44,0X20,0X10,0X18,0X28,0X44,0X06,0X04,0X00}
    0XB0A8 { 0X00,0X1f,0X31,0X51,0X11,0X3f,0X10,0X3a,0X0a,0X0a,0X7a,0X0a,0X0a,0X3b,0X00,0X00,
             0X00,0X7c,0X08,0X08,0X08,0X7c,0X00,0X7c,0X42,0X42,0X42,0X42,0X42,0X62,0X0e,0X00}
    0XB0A9 { 0X08,0X06,0X00,0X3f,0X20,0X20,0X2e,0X2a,0X2a,0X6a,0X2a,0X2a,0X2e,0X60,0X20,0X00,
             0X20,0X62,0X0c,0X70,0X00,0X6f,0X22,0X22,0X62,0X1e,0X62,0X22,0X22,0X6f,0X00,0X00}
    0XB0AA { 0X41,0X51,0X49,0X4d,0X60,0X40,0X5f,0X55,0X55,0X55,0X75,0X55,0X5f,0X40,0X40,0X00,
             0X00,0X00,0X00,0X7e,0X04,0X28,0X5e,0X42,0X4a,0X72,0X48,0X42,0X41,0X7e,0X40,0X00}
    0XB0AB { 0X05,0X09,0X71,0X1f,0X31,0X13,0X09,0X4a,0X4c,0X7f,0X4c,0X0a,0X1b,0X0a,0X00,0X00,
             0X02,0X04,0X18,0X60,0X10,0X4d,0X41,0X52,0X6a,0X44,0X4c,0X72,0X43,0X40,0X40,0X00}
    0XB0AC { 0X20,0X20,0X20,0X20,0X22,0X79,0X20,0X20,0X20,0X79,0X26,0X20,0X20,0X60,0X20,0X00,
             0X01,0X01,0X02,0X02,0X04,0X08,0X50,0X20,0X50,0X08,0X04,0X04,0X02,0X03,0X02,0X00}
    0XB0AD { 0X20,0X21,0X27,0X39,0X21,0X63,0X21,0X7d,0X55,0X55,0X55,0X55,0X7f,0X41,0X00,0X00,
             0X00,0X00,0X7c,0X08,0X08,0X7c,0X40,0X60,0X58,0X42,0X41,0X7e,0X40,0X40,0X40,0X00}
    0XB0AE { 0X02,0X0d,0X49,0X69,0X59,0X49,0X4f,0X79,0X49,0X09,0X19,0X29,0X09,0X0a,0X0c,0X00,
             0X00,0X00,0X02,0X0c,0X31,0X41,0X62,0X54,0X48,0X54,0X64,0X42,0X03,0X02,0X00,0X00}
    0XB0AF { 0X00,0X7f,0X44,0X4a,0X71,0X08,0X49,0X2a,0X0c,0X08,0X0c,0X2a,0X49,0X18,0X08,0X00,
             0X00,0X7f,0X20,0X10,0X62,0X02,0X7e,0X42,0X7e,0X42,0X7e,0X42,0X7e,0X42,0X02,0X00}
    0XB0B0 { 0X20,0X23,0X7a,0X2f,0X7a,0X23,0X25,0X19,0X11,0X17,0X51,0X11,0X11,0X15,0X19,0X00,
             0X10,0X50,0X50,0X7f,0X50,0X50,0X11,0X21,0X52,0X0c,0X08,0X14,0X62,0X03,0X00,0X00}
    0XB0B1 { 0X08,0X10,0X25,0X55,0X55,0X55,0X57,0X55,0X55,0X55,0X55,0X54,0X57,0X40,0X40,0X00,
             0X20,0X20,0X21,0X29,0X3a,0X64,0X24,0X2a,0X32,0X21,0X20,0X20,0X7e,0X01,0X06,0X00}
    0XB0B2 { 0X09,0X31,0X21,0X21,0X21,0X21,0X2f,0X61,0X21,0X21,0X21,0X21,0X21,0X2b,0X31,0X00,
             0X00,0X00,0X01,0X21,0X62,0X12,0X14,0X08,0X08,0X14,0X62,0X03,0X00,0X00,0X00,0X00}
    0XB0B3 { 0X01,0X02,0X04,0X1f,0X60,0X11,0X12,0X14,0X18,0X73,0X18,0X14,0X32,0X13,0X02,0X00,
             0X00,0X00,0X00,0X7f,0X00,0X00,0X7c,0X28,0X28,0X7e,0X29,0X29,0X7d,0X01,0X07,0X00}
    0XB0B4 { 0X08,0X08,0X09,0X7f,0X09,0X05,0X19,0X11,0X11,0X17,0X51,0X11,0X11,0X15,0X19,0X00,
             0X00,0X02,0X01,0X7e,0X00,0X00,0X01,0X21,0X52,0X0c,0X08,0X14,0X62,0X03,0X00,0X00}
    0XB0B5 { 0X00,0X3f,0X21,0X21,0X7f,0X22,0X22,0X2a,0X26,0X62,0X26,0X2a,0X63,0X26,0X02,0X00,
             0X00,0X7c,0X08,0X08,0X7c,0X00,0X7f,0X12,0X12,0X12,0X12,0X12,0X7f,0X00,0X00,0X00}
    0XB0B6 { 0X00,0X00,0X77,0X14,0X15,0X15,0X15,0X75,0X15,0X15,0X15,0X17,0X75,0X04,0X00,0X00,
             0X02,0X04,0X78,0X20,0X20,0X20,0X20,0X20,0X7f,0X20,0X20,0X20,0X60,0X20,0X00,0X00}
    0XB0B7 { 0X00,0X00,0X7f,0X44,0X44,0X7f,0X45,0X19,0X11,0X17,0X51,0X11,0X11,0X15,0X19,0X00,
             0X02,0X04,0X78,0X42,0X41,0X7e,0X00,0X21,0X52,0X0c,0X08,0X14,0X62,0X03,0X00,0X00}
    0XB0B8 { 0X10,0X68,0X48,0X48,0X4a,0X4e,0X59,0X69,0X49,0X4a,0X4c,0X48,0X48,0X58,0X60,0X00,
             0X20,0X22,0X22,0X24,0X28,0X30,0X20,0X7f,0X20,0X30,0X28,0X24,0X26,0X64,0X20,0X00}
    0XB0B9 { 0X00,0X00,0X7f,0X44,0X44,0X7f,0X50,0X10,0X17,0X14,0X54,0X1f,0X14,0X30,0X10,0X00,
             0X02,0X04,0X78,0X42,0X41,0X7e,0X02,0X04,0X78,0X00,0X00,0X7c,0X02,0X02,0X0e,0X00}
    0XB0BA { 0X00,0X01,0X79,0X29,0X29,0X2a,0X2a,0X28,0X29,0X29,0X29,0X29,0X79,0X03,0X01,0X00,
             0X00,0X7c,0X04,0X08,0X08,0X10,0X10,0X00,0X7f,0X00,0X10,0X08,0X04,0X78,0X00,0X00}
    0XB0BB { 0X04,0X04,0X3c,0X24,0X25,0X25,0X26,0X7c,0X26,0X25,0X25,0X24,0X7c,0X24,0X04,0X00,
             0X42,0X42,0X3e,0X22,0X22,0X3e,0X22,0X22,0X22,0X3e,0X22,0X22,0X3e,0X42,0X02,0X00}
    0XB0BC { 0X00,0X3f,0X20,0X20,0X20,0X3f,0X00,0X00,0X00,0X3f,0X20,0X20,0X20,0X7f,0X20,0X00,
             0X00,0X7e,0X04,0X04,0X04,0X44,0X44,0X44,0X44,0X44,0X04,0X04,0X04,0X7e,0X00,0X00}
    0XB0BD { 0X01,0X11,0X15,0X15,0X7f,0X15,0X35,0X15,0X08,0X73,0X10,0X10,0X1f,0X30,0X10,0X00,
             0X02,0X04,0X18,0X64,0X42,0X44,0X79,0X02,0X04,0X68,0X10,0X68,0X06,0X03,0X02,0X00}
    0XB0BE { 0X02,0X22,0X2a,0X2b,0X7e,0X2a,0X6a,0X24,0X08,0X7b,0X08,0X09,0X0e,0X18,0X08,0X00,
             0X10,0X21,0X46,0X00,0X20,0X14,0X62,0X10,0X24,0X42,0X00,0X40,0X24,0X33,0X20,0X00}
    0XB0BF { 0X00,0X3e,0X6a,0X2b,0X2a,0X3e,0X00,0X24,0X22,0X3f,0X00,0X24,0X22,0X7f,0X20,0X00,
             0X10,0X28,0X48,0X3f,0X48,0X28,0X10,0X22,0X41,0X7e,0X00,0X22,0X41,0X7e,0X00,0X00}
    0XB0C0 { 0X10,0X10,0X11,0X77,0X18,0X11,0X21,0X21,0X21,0X3f,0X41,0X41,0X41,0X03,0X01,0X00,
             0X40,0X00,0X00,0X7f,0X00,0X41,0X02,0X04,0X18,0X60,0X18,0X04,0X02,0X03,0X02,0X00}
}
const unsigned char * font_index(unsigned short font_n)
{
    int i;
    if(font_n < 0XB0A1 || font_n > 0XF7FE) 
    {
         return font_16x16[0].font_c;
    }
    for (i = 0; i < font_16x16_count; i++) {
        if (font_16x16[i].font_n == font_n) {
            return font_16x16[i].font_c;
        }
    }
    return font_16x16[0].font_c;
}
